$(document).ready(function(){
	$('#grid_user').datagrid({ 
		url:"findUserInfo.html",
		fit:true,
		fitColumns:true, 
		singleSelect:true,
		pageSize:10,   
	    pageNumber:1,
		columns:[[
			{field:'id',title:'用户id',width:60,resizable:false,align:'center'}, 
			{field:'username',title:'用户名',width:120,resizable:false,align:'center'},
			{field:'password',title:'密码',width:120,resizable:false,align:'center'},
			{field:'usertype',title:'用户类型',width:120,resizable:false,align:'center'},
			{field:'createdate',title:'创建时间',width:120,resizable:false,align:'center'},
			{field:'option',title:'操作',width:60,resizable:false,align:'center',
				formatter:function(value,rowData){
		        return "<a  style='font-size:normal;color:#cc0000;cursor:pointer;' onClick=doDelete('"+rowData.qaId+"')>【删除】</a>&nbsp;";
					}
			}]],
		pagination:true,
	}); 
});
/**
 * 删除问答信息
 */
function doDelete(id){
        $.messager.confirm('提示信息', "您确认删除吗？", function(rf) {
            if(rf){
            	$.ajax({
            		   type: "POST",
            		   url: "deleteUserInfo.html",
            		   data: {qaId:id},
            		   success: function(r){
            			   $.messager.alert('提示信息',r.msg,"", function () {
            				   window.location.reload();
            			   });
            		   }
            		});
            }
        });            
}
